<template>
    <el-row :gutter="20" class="panel-group">
        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col" v-if="shebao">
            <div class="card-panel">
                <div class="top">
                    <div class="card-panel-text">
                        <svg-icon icon-class="order" class-name="card-panel-icon" />
                    </div>
                </div>
                <div class="item">
                    <div class="foot">
                        <div class="card-panel-description">
                            <span class="sp">今日订单总数</span>
                            <div class="count">
                                <span>￥</span>
                                <count-to :start-val="0" :end-val="1000.00" :decimals="2" :duration="2600" class="card-panel-num icon-people" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </el-col>
        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col" v-if="gjj">
            <div class="card-panel">
                <div class="top">
                    <div class="card-panel-text">
                        <svg-icon icon-class="qian" class-name="card-panel-icon" />
                    </div>
                </div>
                <div class="item">
                    <div class="foot">
                        <div class="card-panel-description">
                            <span class="sp">今日销售总额</span>
                            
                            <div class="count">
                                <span>￥</span>
                                <count-to :start-val="0" :end-val="3000.00" :decimals="2"  :duration="2600" class="card-panel-num icon-people" />
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </el-col>
        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col" v-if="archive">
            <div class="card-panel">
                <div class="top">
                    <div class="card-panel-text">
                        <svg-icon icon-class="qian1" class-name="card-panel-icon" />
                    </div>
                </div>
                <div class="item">
                    <div class="foot">
                        <div class="card-panel-description">
                            <span class="sp">昨日销售总额</span>
                           <div class="count">
                                <span>￥</span>
                                <count-to :start-val="0" :end-val="2000.00" :decimals="2" :duration="2600" class="card-panel-num icon-people" />
                            </div>
                        </div>

                    </div>

                </div>
            </div>
        </el-col>
        <el-col :xs="6" :sm="6" :lg="6" class="card-panel-col" v-if="house">
            <div class="card-panel">
                <div class="top">
                    <div class="card-panel-text">
                        <svg-icon icon-class="up" class-name="card-panel-icon" />
                    </div>
                </div>
                <div class="item">
                    <div class="foot">
                        <div class="card-panel-description">
                            <span class="sp">近7天销售总额</span>
                            <div class="count">
                                <span>￥</span>
                                <count-to :start-val="0" :end-val="5000.00" :decimals="2" :duration="2600" class="card-panel-num icon-people" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </el-col>
    </el-row>
</template>

<script>
import CountTo from 'vue-count-to'
// import { getSubtotal, GET } from '@/api/index'

export default {
    props: {
        shebao: {
            type: Object,
            default: function () {
                return {}
            }
        },
        gjj: {
            type: Object,
            default: function () {
                return {}
            }
        },
        archive: {
            type: Object,
            default: function () {
                return {}
            }
        },
        house: {
            type: Object,
            default: function () {
                return {}
            }
        },
    },
    components: {
        CountTo
    },
    data() {
        return {
            numobj: {}
        }
    },
    created() {
        this.getData();
    },
    methods: {
        getData() {
            // getSubtotal().then(res => {
            //     this.numobj = res.data;
            // })
        },
    }
}
</script>

<style lang="scss" scoped>
.panel-group {
    .card-panel-col {
        margin-bottom: 20px;
    }
    .card-panel {
        border-radius: 4px;
        font-size: 16px;
        position: relative;
        overflow: hidden;
        background: #fff;
        box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(228, 228, 228, 1);
        padding: 15px;
        display: flex;
        align-items: center;
        .top {
            .card-panel-text {
                font-size: 14px;
                margin-bottom: 12px;
            }
            .card-panel-icon-wrapper {
                transition: all 0.38s ease-out;
            }
        }
        .item {
            width: 100%;
            display: flex;
            .foot {
                width: 100%;
                padding-right: 2%;
                .card-panel-description {
                    padding-left: 15%;
                    .card-panel-num {
                        font-size: 20px;
                        font-weight: bold;
                    }
                    .sp {
                        width: 100%;
                        font-size: 16px;
                        color: #999999;
                        margin-right: 5px;
                    }
                    .count {
                        font-size: 22px;
                        font-weight: 600;
                    }
                }
            }
        }
        .card-panel-icon {
            float: left;
            margin-right: 8px;
            font-size: 48px;
        }
    }
}
</style>
